package cn.virens.library;

import android.content.Context;
import android.content.res.XmlResourceParser;
import android.text.TextUtils;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import java.io.IOException;

/**
 * Created by loioi on 2017/10/29.
 */

public class ConfigManager {
    public void init(Context context) throws IOException, XmlPullParserException {
        XmlResourceParser xrp = context.getAssets().openXmlResourceParser("config/config.cml");

        while (xrp.getEventType() != XmlResourceParser.END_DOCUMENT) {
            if (xrp.getEventType() == XmlResourceParser.START_TAG) {
                String name = xrp.getName();
                if (TextUtils.equals(name, "server")) {
                    xrp.getAttributeValue(null,"api");

                }
            } else if (xrp.getEventType() == XmlPullParser.END_TAG) {
            } else if (xrp.getEventType() == XmlPullParser.TEXT) {
            }
            //下一个标签
            xrp.next();
        }
    }
}
